<template>
  <div class="wrapper">
    <h1>
      {{ previewData.reportName }}
    </h1>
    <div class="title">
      <div>{{ previewData.createDeptName }}</div>
      <div>{{ previewData.createTime }}</div>
    </div>
    <div v-if="dutyType == '2'" class="content">
      <el-form ref="form" :model="previewData" label-position="top" class="form">
        <el-form-item label="一、总体情况：">
          <div class="form-text">{{ previewData.eventMonitor }}</div>
        </el-form-item>
        <el-form-item label="二、应急处置情况：">
          <div class="form-text">{{ previewData.powerWork }}</div>
        </el-form-item>
      </el-form>
      <AccessoryTable />
    </div>
    <div v-else class="content">
      <el-form ref="form" :model="previewData" label-position="top" class="form">
        <el-form-item label="总体情况:">
          <div class="form-text">{{ previewData.eventMonitor }}</div>
        </el-form-item>
        <ColumnTable :showIndex="true" :tableColumn="wrningColumn" :tableData="previewData.powerList"
          style="width: 100%;padding: 10px 0 30px;" />
        <el-form-item label="采取措施情况:">
          <div class="form-text">{{ previewData.measuresTaken }}</div>
        </el-form-item>
        <el-form-item label="下一步工作安排:">
          <div class="form-text">{{ previewData.nextWorkArrangement }}</div>
        </el-form-item>
        <el-form-item label="工作建议::">
          <div class="form-text">{{ previewData.nextStepsSuggestions }}</div>
        </el-form-item>
      </el-form>
    </div>
    <el-descriptions :labelStyle="{
      display: 'inline-block',
      textAlign: 'right',
      width: '100px',
      fontSize: '18px',
    }" :contentStyle="{ fontSize: '18px' }">
      <el-descriptions-item label="值班主任">{{ previewData.approvalUser }}</el-descriptions-item>
      <el-descriptions-item label="值班员">{{ previewData.creator }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>
<script>
import AccessoryTable from "../dutyRinght/accessoryTable.vue";
import ColumnTable from "../../../Daily/DailyDuty/columnTable/index.vue";
import { wrningColumn } from "../dutyRinght/config";
export default {
  provide() {
    return {
      isShow: () => false
    };
  },
  components: {
    AccessoryTable,
    ColumnTable
  },
  props: {
    previewData: {
      type: Object,
      default: () => {
        return {};
      }
    },
    dutyType: {
      type: String || Number,
      default: "1" // 2应急   1预警
    }
  },
  data() {
    return {
      wrningColumn
    };
  }
};
</script>
<style lang="less" scoped>
.wrapper {
  h1 {
    text-align: center;
  }

  .title {
    line-height: 60px;
    display: flex;
    font-size: 20px;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;

    >div {
      width: 50%;
      border: 1px solid #797979;
      padding: 0 1rem;
    }

    >div:nth-child(2) {
      text-align: right;
    }
  }
}

.content {
  padding: 0 20px;
}

.el-form {
  margin-top: 20px;

  :deep(.el-form-item__label) {
    line-height: 30px;
    font-size: 18px;
  }

  :deep(.el-form-item__content) {
    line-height: 20px;
    font-size: 18px;
    text-indent: 1em;
  }
}

:deep(.table-title) {
  font-size: 18px;
}

.form-text {
  margin-left: 25px;
}
</style>
